// The Swift Programming Language
// https://docs.swift.org/swift-book
import AgoraCPP
import Foundation
open class AgoraToken2Generator {
    public static func generateRTCToken2(with appID: String, appCert: String, channelID: String ,uid: UInt32, expire: UInt32) -> String {
        let appIDArray: [CChar] = appID.cString(using: .ascii)!
        let appCertArray: [CChar] = appCert.cString(using: .ascii)!
        let channelIDArray: [CChar] = channelID.cString(using: .ascii)!
        let result = generateRTCToken(appIDArray, appCertArray,  channelIDArray,uid, expire)
        if (result == nil) {
            return ""
        }
        return String(cString: result!)
    }
}
